#include "headfiles.h"
#include <stdlib.h>

int main(int argc, char **argv) {
    if (argc != 2) {
        cout << "Usage: " << argv[0] << " num" << endl;
        return 0;
    }

    unsigned int val = (unsigned int)atoi(argv[1]);
    unsigned int s_n, b_n;

    calcIntWithSameBitOnes(val, s_n, b_n);

    cout << "Num: " << val << ": ";
    printBits(val);
    cout <<"Smaller neighbor: ";
    printBits(s_n);
    cout <<"Larger neighbor: ";
    printBits(b_n);

    unsigned int dist;
    dist = calcBitDistance(s_n, b_n);
    cout << "Bit distance is " << dist << endl;

    unsigned int swapedVal = swapBits(val);
    printBits(val);
    printBits(swapedVal);

    return 0;
}

